import {getAllDeviceTree} from '../../assets/js/service.business';

export default {
    state: {
        device: {},
    },
    mutations: {
        set_device: function (state, res) {
            state.device = res;
        },
    },
    actions: {
        asyncGetAllDeviceTree: async function ({commit}) {
            let res = await getAllDeviceTree();
            if (res.code === 0) {
                commit('set_device', res);
            } else {
                commit('set_device', [])
            }
            return res;
        }
    }
};
